package com.stox.ui.javafx.charting.model.enumeration;

import java.util.Calendar;

import com.stox.ui.javafx.core.util.MessageSource;

public enum SpanType {

	MINUTELY_1(Calendar.MINUTE, 1, MessageSource.getMessage("Minutely")+" (1)"), 
	MINUTELY_5(Calendar.MINUTE, 5, MessageSource.getMessage("Minutely")+" (5)"), 
	MINURELY_15(Calendar.MINUTE, 15, MessageSource.getMessage("Minutely")+" (15)"), 
	HALF_HOURLY(Calendar.MINUTE, 30, MessageSource.getMessage("HalfHourly")), 
	HOURLY(Calendar.HOUR, 1, MessageSource.getMessage("Hourly")), 
	DAILY(Calendar.DATE, 1, MessageSource.getMessage("Daily")), 
	WEEKLY(Calendar.WEEK_OF_YEAR, 1, MessageSource.getMessage("Weekly")), 
	MONTHLY(Calendar.MONTH, 1, MessageSource.getMessage("Monthly")), 
	QUARTERLY(Calendar.MONTH, 3, MessageSource.getMessage("Quarterly")), 
	YEARLY(Calendar.YEAR, 1, MessageSource.getMessage("Yearly"));

	private final int unit;
	private final int count;
	private final String text;

	private SpanType(int unit, int count, String text) {
		this.unit = unit;
		this.count = count;
		this.text = text;
	}

	public int getCount() {
		return count;
	}

	public int getUnit() {
		return unit;
	}

	public String getText() {
		return text;
	}
	
	@Override
	public String toString() {
		return getText();
	}
	
}
